#!/bin/sh

PORT=7777
PIDFILE="/var/run/warvox/mongrel.pid"

start() {
  echo "Starting WarVOX: warvox -p ${PORT} -d "
  warvox -p $PORT -d
}

stop() {
  echo "Stopping WarVOX..."
  kill $(cat $PIDFILE)
}

case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart)
    stop
    sleep 1
    start
    ;;
  *)
    echo "Usage: $0 (start|stop|restart)"
esac
